home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / event.d / rc-default < prev    next >
Encoding:
Text File  |  2007-03-11  |  485 b   |  24 lines

  1. # rc - runlevel compatibility
  2. #
  3. # This task guesses what the "default runlevel" should be and starts the
  4. # appropriate script.
  5.  
  6. start on stopped rcS
  7.  
  8. script
  9.     runlevel --reboot || true
  10.  
  11.     if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
  12.         telinit S
  13.     elif [ -r /etc/inittab ]; then
  14.         RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
  15.         if [ -n "$RL" ]; then
  16.         telinit $RL
  17.         else
  18.         telinit 2
  19.         fi
  20.     else
  21.         telinit 2
  22.     fi
  23. end script
  24.